﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Drawing2D;
using System.Drawing;

namespace Maniac
{
    class GradientHelper
    {
        private GradientHelper()
        {
        }
        public static void GradientRect(Graphics g, Rectangle bounds, Color a, Color b)
        {
            if ((bounds.Height > 0) && (bounds.Width > 0))
            using (LinearGradientBrush br = new LinearGradientBrush(bounds, b, a, -90))
            {
                
                    g.FillRectangle(br, bounds);
            }
        }

        public static void GlossyRect(Graphics g, Rectangle bounds, Color a, Color b, Color c, Color d)
        {
            //g.FillRectangle(new SolidBrush(c), bounds);
            Rectangle top = new Rectangle(bounds.Left, bounds.Top, bounds.Width, bounds.Height / 2);
            Rectangle bot = Rectangle.FromLTRB(bounds.Left, top.Bottom, bounds.Right, bounds.Bottom);

            GradientHelper.GradientRect(g, top, a, b);
            GradientHelper.GradientRect(g, bot, c, d);
        }
    }
}
